home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / TPWENG / GETALPHA.PAS < prev    next >
Pascal/Delphi Source File  |  1991-07-22  |  866b  |  34 lines

  1. program GetAlpha;
  2. uses PXEngine, WinCrt;
  3.  
  4. const TableName = 'Table';
  5.  
  6. var   PxErr: Integer;
  7.       TblHandle: TableHandle;
  8.       RecHandle: RecordHandle;
  9.       FldHandle: FieldHandle;
  10.       AValue: array[0..255] of char;
  11.  
  12. procedure PX(Code : integer);
  13. begin
  14.   writeln(PXErrMsg(Code));
  15. end;
  16.  
  17. begin
  18.   PX(PXWinInit('MyApp', pxShared));
  19.   PX(PXTblOpen(TableName, TblHandle, 0, False));
  20.   PX(PXRecBufOpen(TblHandle, RecHandle));
  21.   PX(PXFldHandle(TblHandle, 'Alpha Field', FldHandle));
  22.   PX(PXRecGet(TblHandle, RecHandle));
  23.  
  24.   (* Get an alphanumeric value out of a field *)
  25.   PxErr := PXGetAlpha(RecHandle, FldHandle, 255, @AValue);
  26.   if PxErr <> PxSuccess then
  27.     Writeln(PxErrMsg(PxErr))
  28.   else Writeln('Field number ', FldHandle, ' contents: ', AValue);
  29.  
  30.   PX(PXRecBufClose(RecHandle));
  31.   PX(PXTblClose(TblHandle));
  32.   PX(PXExit);
  33. end.
  34.